package 矩阵.最富有客户的资产总量;

/**
 * TODO
 *
 * @className: zfykhzczl
 * @description: TODO
 * @author: 等什么柠檬君
 * @date: 2022-05-05 19:29
 **/
public class zfykhzczl {
    public static void main(String[] args) {
        int[][] accounts = {{1,2,3},{3,2,1}};
        System.out.println(maximumWealth(accounts));

    }
    public static int maximumWealth(int[][] accounts) {
        int max = 0;
        for(int i = 0;i < accounts.length;++i){
            int result = 0;
            for(int j = 0;j < accounts[i].length; ++j){
                result += accounts[i][j];
            }
            if(result > max){
                max = result;
            }
        }
        return max;
    }
}
